class PlattformsController < ApplicationController
  # GET /plattforms
  # GET /plattforms.xml
  def index
    @plattforms = Plattform.find(:all)

    respond_to do |format|
      format.html # index.html.erb
      format.xml  { render :xml => @plattforms }
    end
  end

  # GET /plattforms/1
  # GET /plattforms/1.xml
  def show
    @plattform = Plattform.find(params[:id])

    respond_to do |format|
      format.html # show.html.erb
      format.xml  { render :xml => @plattform }
    end
  end

  # GET /plattforms/new
  # GET /plattforms/new.xml
  def new
    @plattform = Plattform.new

    respond_to do |format|
      format.html # new.html.erb
      format.xml  { render :xml => @plattform }
    end
  end

  # GET /plattforms/1/edit
  def edit
    @plattform = Plattform.find(params[:id])
  end

  # POST /plattforms
  # POST /plattforms.xml
  def create
    @plattform = Plattform.new(params[:plattform])

    respond_to do |format|
      if @plattform.save
        flash[:notice] = 'Plattform was successfully created.'
        format.html { redirect_to(@plattform) }
        format.xml  { render :xml => @plattform, :status => :created, :location => @plattform }
      else
        format.html { render :action => "new" }
        format.xml  { render :xml => @plattform.errors, :status => :unprocessable_entity }
      end
    end
  end

  # PUT /plattforms/1
  # PUT /plattforms/1.xml
  def update
    @plattform = Plattform.find(params[:id])

    respond_to do |format|
      if @plattform.update_attributes(params[:plattform])
        flash[:notice] = 'Plattform was successfully updated.'
        format.html { redirect_to(@plattform) }
        format.xml  { head :ok }
      else
        format.html { render :action => "edit" }
        format.xml  { render :xml => @plattform.errors, :status => :unprocessable_entity }
      end
    end
  end

  # DELETE /plattforms/1
  # DELETE /plattforms/1.xml
  def destroy
    @plattform = Plattform.find(params[:id])
    @plattform.destroy

    respond_to do |format|
      format.html { redirect_to(plattforms_url) }
      format.xml  { head :ok }
    end
  end
end
